<p style="font-weight: bolder">经甲乙双方确认根据下列条款订立本合同：</p>
<style>
    #tab01 > tbody > tr > td, #tab01 > thead > tr > th {
        text-align: center;
        vertical-align: middle;
        border: 1px solid #000;
    }
    #tab01 {
        border-collapse: collapse;
    }
</style>
<table id="tab01" class="table">
    {{--<thead>--}}
    <tr style="text-align: center;vertical-align: middle;border: 1px solid #000;">
        <th width="12%" >SKU|ModelNo</th>
        <th width="10%">产品名称</th>
        <th width="10%">图片</th>
        <th width="32%">产品描述</th>
        <th width="8%">单价(RMB)</th>
        <th width="6%">数量(PCS)</th>
        <th width="10%">总额(RMB)</th>
        <th width="12%">交货日期</th>
    </tr>
    {{--</thead>--}}
    <tbody>
    @php
        $orderNum = 0;
        $orderAmount = 0;
    @endphp
    @foreach($purchase->order_detail as $item)
        @php
            $orderNum += $item->order_num ?: 0;
            $orderAmount += round(($item->supplier_price ?:0) * ($item->order_num?:0),3);
        @endphp
        @if($item->order_num != 0)
        <tr>
            <td>{{ $item->sku->psku_code ?? '' }}<br/><br/>({{ $item->skuClassify->model_no ?? '' }})</td>
            <td>{{ $item->sku->psku_cn ?? '' }}</td>
            <td>
                @if(!isset($item->sku->img) || !$item->sku->img)
                    {{ "/" }}
                @else
                    {!! \App\Models\Product\ProductSku::getMainImage($item->sku->img) !!}
                @endif
            </td>
            <td style="text-align: left;width: 100%;">
                @if(!isset($param[$item->id]['describe']) || !$param[$item->id]['describe'])
                    {{ "/" }}
                @else
                    <pre>{{ $param[$item->id]['describe'] }}</pre>
                @endif
            </td>
            <td>{{ $item->supplier_price }}</td>
            <td>{{ $item->order_num }}</td>
            <td>{{ round($item->supplier_price * $item->order_num,3) }}</td>
            <td>{{ date('Y-m-d',strtotime('-7 days',strtotime($purchase->commit_date))) }}</td>
        </tr>
        @endif
    @endforeach
    <tr>
        <td style="font-weight: bolder">合计</td>
        <td style="font-weight: bolder">{{ $param['tax'] }}</td>
        <td style="font-weight: bolder">{{ \App\Models\Basics\Supplier::$_shipFeeType[$param['ship_fee_type']] }}</td>
        <td></td>
        <td></td>
        <td style="font-weight: bolder">{{ $orderNum ?: "/" }}</td>
        <td style="font-weight: bolder">{{ $orderAmount ?: "/" }}</td>
        <td></td>
    </tr>
    </tbody>
</table>
